<form name="frmsearch" id="frmsearch" action="<?php echo base_url()?>products/listsale" method="post">
  <table class="frmsearch" width="100%" cellspacing="5px" style="background: #ffefdd; color:#000; margin:0px 0px 10px; padding:10px; height:50px">            
                <tbody>
                    <tr>
                        <td style="padding:10px 10px 10px 30px; width:25%;"><label class="lb" style="padding-top:5px">Tên sản phẩm:</label><input type="text"  name="name" id="name" value="<?php if(isset($name)) echo $name; ?>"></td>  
                        <td style="padding:10px 10px 10px 0px;width:25%; text-align:left">
                        <label class="lb" style="padding-top:5px">Danh mục:</label>
                        <select name="product_category_id">
                            <option value="">Chọn danh mục sản phẩm</option>
                            <?php echo $option_pid;?>
                        </select>
                        </td> 
                        <td align="right" style="padding:10px 30px 10px 0px; width:25%;text-align:left">
                        <select name="partners_pid">
                            <option value="">Thương hiệu</option>
                            <?php echo $partners_id;?>
                        </select> 
                        
                        </td>                  
                    </tr>
                    <tr>
                        <td style="padding:10px 10px 10px 30px; width:25%;"><label class="lb" style="padding-top:5px">Mã sản phẩm (SKU):</label><input type="text"  name="sku" id="sku" value="<?php if(isset($sku)) echo $sku; ?>"></td>  
                        <td style="padding:10px 10px 10px 0px;width:25%; text-align:left">
                        <label class="lb" style="padding-top:5px">Tình trạng:</label>
                        <select name="conhang">
                         	<option value="">Chọn tình trạng</option>
                            <option value="1" <?php if(isset($conhang) && $conhang==1) echo 'selected'?>>Còn hàng</option>
                            <option value="2" <?php if(isset($conhang) && $conhang==2) echo 'selected'?>>Hết hàng</option>
                        </select>
                        </td> 
                        <td align="right" style="padding:10px 30px 10px 0px; width:25%;text-align:left"><input type="submit" id="ordersearch" name="ordersearch" value="Tìm sản phẩm"></td>                  
                    </tr>
                </tbody>
            </table>
 </form>
<?$attributes = array('class' => 'email', 'id' => 'checknew');
echo form_open('products/dels', $attributes);?>    

<input type="hidden" name="page" value="<?php echo (int)$this->uri->segment('3')?>">

        <table class="admindata">
            <thead>
                <tr>
                    <th colspan="11">
                        
                            <input type="submit" onclick="return verify_del();" name="btn_submit" class="submit" value="Xóa">
                      
                        Hiện có <?php echo $num?> sản phẩm 
                        <div class="fr">
                           <!-- <a href="<?php echo site_url('products/add')?>">Thêm mới</a> -->
                        </div>
                    </th>
                </tr>
                <tr class="head_tb">
                    <th class="checkbox"><input type="checkbox" name="sa" id="sa" onclick="check_chose('sa', 'ar_id[]', 'checknew')" /></th>
                    <th width="40" style="text-align:center">STT</th>
                    <th width="">Danh mục sản phẩm</th>
                    <th width="">Tên sản phẩm</th>
                   	<th width="">Giá bán</th>
                    <th width="100">Hình đại diện</th>
                    <th width="">Số lượng còn lại</th>
                    <th class="publish" style="width: 120px;">Active</th>
                </tr>                
            </thead>
            <?
            $k=1;$i=1;
            foreach($list as $rs):?>
            <tr class="row<?php echo $k?>">
                <td><input type="checkbox" name="ar_id[]" value="<?php echo $rs->products_id ?>"></td>
               
                 <td style="text-align:center"><?php echo $i;?></td>
                   <td>
                   <?php echo $rs->pro_cate_name?>
                </td>
                <td>
                   <?php echo $rs->name?>
                </td>
                 <td>
                   <?php echo number_format($rs->price, 0, ',', '.')?>
                </td>
                
                 <td >
                  <img src="<?php echo base_url_site()."uploads/products/avatar/".$rs->image;?>" alt="" width="100" height="100" />
                </td>
                <td>
                  <?php echo $rs->soluong?>
                </td>
                 
                 
                <td align="center">
                <?php if($this->acl->check('edit','mod_products','products')){ ?> 
                    <?php echo icon_edit('products/edit/'.$rs->products_id)?>
                <?php } ?>
                 <span id="publish<?php echo $rs->products_id?>"><?php echo icon_active("'products'","'products_id'",$rs->products_id,$rs->bl_active)?></span>
                 <?php if($this->acl->check('del','mod_products','products')){ ?> 
                    <?php echo icon_del('products/del/'.$rs->products_id.'/'.(int)$this->uri->segment(4))?>
                    <?php } ?>
                   
                </td>
            </tr>
            <?
			$i++;
            $k=1-$k;
            endforeach;?>
            <tfoot>
                <td colspan="11">
                        <input type="submit" onclick="return verify_del();" name="btn_submit" class="submit" value="Xóa">
                    Hiện có <?php echo $num?>  sản phẩm  <span class="page_click"><?php echo $pagination?></span>
                </td>
            </tfoot>
        </table>  
<?php echo form_close()?>  
<script type="text/javascript">
	$(document).ready(function(){
		$( ".page_click a" ).click(function() {
		  var page_url = $(this).attr('href');
		  $('#frmsearch').attr('action',page_url);
		  $('#frmsearch').submit();
		  return false;
		});
	});
 
</script>
